//
//  FeedbackViewController.m
//  SelfDriving
//
//  Created by apple on 16/1/11.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "FeedbackViewController.h"
#import "BusinessService+WD.h"
@interface FeedbackViewController ()
@property (weak, nonatomic) IBOutlet UITextField *textField;

@end

@implementation FeedbackViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationController.navigationBarHidden = NO;
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [self.view endEditing:YES];
}
#pragma mark 提交
- (IBAction)submitAction:(id)sender {
    if([_textField.text trim].length == 0 ){
        [SVProgressHUD showErrorWithStatus:@"请输入反馈内容"];
        return;
    }NSMutableDictionary *dic= [[NSMutableDictionary alloc]init];
    [dic setObject:_textField.text forKey:@"content"];
    [[BusinessService shareInstance]feedback:dic success:^(id result) {
        LoginResponseModel * model = result;
        [SVProgressHUD showSuccessWithStatus:model.msg];
        [self.navigationController popViewControllerAnimated:YES];
    } failure:^(id result) {
        [SVProgressHUD showErrorWithStatus:result];
    }];
    
}


- (IBAction)backActino:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
